<style>
#VIEW-login{
    height: 100%;
    background:#252834;
    padding-top:1px;
    margin-top:-1px;
}
#VIEW-login .layui-logo{
    user-select: none;
    overflow: hidden;
    position: static;
    font-size: 30px;
    color:#d6e0f6;
    width: 100%;
    padding:0;
    line-height: 120px;
    height: 120px;
    color:#3491ff;
    font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
    transition: height .8s cubic-bezier(0.075, 0.82, 0.165, 1);

    text-align: center;
}
#VIEW-login .layui-logo span{
    font-weight: normal;
    color:#fff;
    border-bottom: 1px solid #3491ff;
}
#VIEW-login .layui-logo span b{
    color:#3491ff;
}


#VIEW-login .login-wrap{
    margin-top: 80px;
}

#VIEW-login .layui-form{
    overflow: hidden;
    background: #fff;
    padding:40px;
    padding-bottom:20px;
    box-shadow: 0 0 30px #000;
    position: relative;
    border-radius: 5px;
}
#VIEW-login .layui-form-item{
    position: relative;
}
#VIEW-login .verify-block{
    display: none;
}
#VIEW-login .layui-input{
    text-indent:26px;
}
#VIEW-login .codeimg{
    margin-left: 10px;
    cursor: pointer;
}
#VIEW-login .sendsms{
    position: absolute;
    top:4px;
    right: 4px;
    width: 100px;
    border:none;
}
#VIEW-login .sendsms.layui-btn-disabled{
    background: #f4f4f4;
    color:#bbb;
}
#VIEW-login .houseimg{
    text-align: center;
}
#VIEW-login .houseimg img{
    display: inline-block;
    margin-top:5%;
}

#VIEW-login .login-type-tab{
    margin-bottom: 20px;
    overflow: hidden;
}
#VIEW-login .login-type-tab li{
    display: inline-block;
    padding-right: 20px;
    font-size: 16px;
    line-height: 30px;
    color:#bbb;
    cursor: pointer;
    transition: color .5s ease;
}
#VIEW-login .login-type-tab li.active{
    color:#333;
}
#VIEW-login .login-type-tab li .qrcode-icon{
    font-size: 24px;
}
#VIEW-login .phonecode-block{
    display: none;
}
#VIEW-login .qrcode-block{
    text-align: center;
    display: none;
}

#VIEW-login .qrcode-block .qrcode{
    border:1px solid #eee;
    display: inline-block;
    padding:15px;
    margin:30px 0;
    width: 158px;
    height: 158px;
}

#VIEW-login .qrcode-block .qrcode .layui-icon{
    line-height: 158px;
    font-size: 44px;
    color:#e6e6e6;
}
#VIEW-login .qrcode-block .p1{
    font-size: 16px;
}
#VIEW-login .qrcode-block .p2{
    font-size: 14px;
    color:#999;
    margin-top:10px;
    margin-bottom: 20px;
}
#VIEW-login .layui-form-item .label-icon{
    position: absolute;
    top:0;
    left:0;
    width: 38px;
    line-height: 38px;
    text-align: center;
    color: #d2d2d2!important;
}
html {
    background-color: #252834;
}
.layui-btn-normal {
    background-color: #5a8bff;
}
</style>
<div id="VIEW-login" lay-title="登录">
    <div class="login-wrap">
        <div class="layui-container">
            <div class="layui-row">
                <div class="layui-col-xs12 layui-col-lg4 layui-col-lg-offset4 nepadmin-tc">
                    <div class="layui-logo"><span><b>SKU</b>管理系统</span></div>
                </div>
                <div class="layui-col-xs12 layui-col-lg4 layui-col-lg-offset4">
                    <div class="layui-form" lay-filter="login-form">
                        <div class="normal-login-form">
                            <div class="layui-form-item">
                                <label class="layui-icon label-icon layui-icon-username"></label>
                                <input type="text" name="username" value="" lay-verify="required" lay-verType="tips" placeholder="OA账号"  autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-form-item password-block">
                                <label class="layui-icon label-icon layui-icon-password"></label>
                                <input type="password" name="pass" value="" lay-verify="required" lay-verType="tips" placeholder="OA密码" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-form-item">
                                <button class="layui-btn layui-btn-normal layui-btn-fluid LAY-submit" lay-submit lay-filter="login-submit">
                                    <i style="display: none" class="layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop"></i>
                                    立即登录
                                </button>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>

layui.use(['admin', 'table', 'form','toolJ'],function(){
    var $ = layui.$
        ,setter = layui.setter
        , toolJ = layui.toolJ
        , admin = layui.admin
        ,router = layui.router()
        ,search = router.search
        , form = layui.form;
    ;
    admin.req({
        url: '/index/User/logout'
        ,type: 'get'
        ,data: {}
        ,done: function(res){
            //清空本地记录的 token，并跳转到登入页
            admin.exit();
        }
    });
    $(document).keydown(function (e) {
        if (e.which == 13) {
            //$('.LAY-submit').trigger('click');
            $('.LAY-submit').trigger('click');
        }
    });
    //提交登录表单
    form.on('submit(login-submit)',function(data){
        //请求登入接口
        toolJ.ajax({"data":data.field},function (res) {
            if(res.code==1){
                //请求成功后，写入 access_token
                admin.cacheConfig(res);
                location.hash = search.redirect&& typeof search.redirect!='undefined'? decodeURIComponent(search.redirect) : '/';
            }
        });
    })

})
</script>